package action;




import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import entity.Users;
import dao.UsersDao;

public class LoginAction extends ActionSupport{
	
	
	private static final String SUUESS = null;
	private Users user;

	public Users getUser() {
		return user;
	}

	public void setUser(Users user) {
		this.user = user;
	}

	@Override
	public String execute() throws Exception {
		UsersDao dao = new UsersDao();
		Users user = dao.findUser(getUser());
		if(user!=null){
			ActionContext.getContext().getSession().put("user", user);
			return SUCCESS;
		}else{
			return INPUT;
		}
		
		
	}
	
}
